<template>
  <div class="st-charts-frame">
    <div class="st-charts-frame-box">
      <div class="st-charts-frame-head">
        <div class="st-charts-frame-subject">
          <svg class="icon" aria-hidden="true">
            <use :xlink:href="'#icon-' + icon" />
          </svg>
          <div class="st-charts-frame-title">{{title}}</div>
          <div class="st-charts-frame-line">
            <img src="//cform-sensetime.oss-cn-hangzhou.aliyuncs.com/stchart/icon-line.svg" />
          </div>
        </div>
        <div class="st-charts-frame-subtitle" v-if="subtitle">{{subtitle}}</div>
      </div>
      <div :class="'st-charts-frame-body ' + (subtitle?'':'single')">
        <slot></slot>
      </div>
    </div>
  </div>
</template>

<script>
/*eslint-disable*/
import "../iconfont.js";
export default {
  props: {
    icon: {
      type: String,
      default: "icon_transparency-1"
    },
    title: {
      type: String,
      default: "这是标题"
    },
    subtitle: {
      type: String,
      default: "这是副标题"
    }
  }
};
</script>

<style>
.st-charts-frame-box .icon {
  width: 24px;
  height: 24px;
  vertical-align: -3.6px;
  fill: currentColor;
  overflow: hidden;
}
.st-charts-frame {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  /* background: url(//cform-sensetime.oss-cn-hangzhou.aliyuncs.com/stchart/frame01.png)
    left top no-repeat;
  background-size: auto 100%; */
}
.st-charts-frame-box {
  position: relative;
  height: 100%;
}
.st-charts-frame-subject {
  display: flex;
  align-items: center;
}

.st-charts-frame-title {
  font-size: 16px;
  font-family: "PingFang SC Regular";
  font-weight: 500;
  color: #fff;
  line-height: 24px;
  margin: 0 5px;
}

.st-charts-frame-subtitle {
  font-size: 14px;
  font-family: "PingFang SC Regular";
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  line-height: 20px;
  text-indent: 29px;
}

.st-charts-frame-line {
  flex: 1;
}

.st-charts-frame-line img {
  width: 100%;
}
</style>
